package com.example.mysaat;

import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.Toast;

public class MyMainOnItemClick implements AdapterView.OnItemClickListener {
    @Override
    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
        transmissonActivityByItem(i);
    }

    private void transmissonActivityByItem(int num){
        Intent intent = null;
        switch (num){
            case 0:{
                // 自动有序的测试所有的页面
                Toast.makeText(MainActivity.context,"Auto test need to develop",Toast.LENGTH_SHORT).show();
                break;
            }
            case 1:{
                intent = new Intent("android.intent.action.ServiceMenuManualTest");
                intent.addCategory("android.intent.category.ServiceMenuManualTest");
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                MainActivity.context.startActivity(intent);
                break;
            }
            case 2:{
                Toast.makeText(MainActivity.context,"Service AAT ver:1",Toast.LENGTH_SHORT).show();
                break;
            }
            case 3:{
                intent = new Intent();
                intent.setAction("android.intent.action.ServiceMenuTestResult");
                intent.addCategory("android.intent.category.ServiceMenuTestResult");
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                MainActivity.context.startActivity(intent);
                break;
            }
        }
    }

}


/*
intent = new Intent("com.example.components.activities.Gradienter.ACTION_START");
                intent.addCategory("android.intent.category.GRADIENT");
                intent.addFlags(FLAG_ACTIVITY_NEW_TASK);
                MainActivity.context.startActivity(intent);
 */